<template>
	<view class="box">
		<uNavbar title="道具订单详情" bgColor="#262241"></uNavbar>
		<!--我接收的 -->
		<view class="main" >
			<view class="main_from_top">
				<image :src="info.prop_image" mode="aspectFill"></image>
				<view class="name">
					{{info.prop_name}}
				</view>
				<view class="text">
					{{info.brand_name}}
				</view>

				<view class="price">
					X{{info.ful_number}}
				</view>
			</view>
<!-- 			<view class="main_btn_wrap">
				<view class="zz_btn">
					转赠
				</view>
				<view class="gm_btn">
					挂卖
				</view>
			</view> -->
		</view>

		<view class="main_from">
			<view class="main_from_bottom">
				<view class="title">
					订单信息
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A6A5AF;">订单编号</text>
					<text>{{info.rent_sn}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A6A5AF;">订单状态</text>
					<text>{{info.status_desc}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A6A5AF;">订单金额</text>
					<text>{{info.price}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A6A5AF;">手续费</text>
					<text>{{info.service_fee}}</text>
				</view>
				<view class="main_from_bottom_item">
					<text style="color: #A6A5AF;">到账金额</text>
					<text>{{info.actual_price}}</text>
				</view>
				<view class="main_from_bottom_item" v-if="status==2">
					<text style="color: #A6A5AF;">买方</text>
					<text>{{info.buyer_name}}</text>
				</view>
				<view class="main_from_bottom_item" v-if="status==2">
					<text style="color: #A6A5AF;">付款时间</text>
					<text>{{info.pay_time}}</text>
				</view>
				<view class="main_from_bottom_item" v-if="status==-1">
					<text style="color: #A6A5AF;">取消时间</text>
					<text>{{info.cancel_time}}</text>
				</view>
			</view>
		</view>
		<view class="btn" v-if="status==0" @click="tipShow2=true">
			取消
		</view>
				<u-popup :show="tipShow2" mode="center" @close="tipShow2 = false" closeable bgColor="transparent">
					<view class="prompt flex_ZC">
						<text class="f36">提示</text>
						<text class="prompt_tit">确定要取消订单吗</text>
		
						<view class="prompt_ntm" @click="canelorder()">
							<text>确定</text>
						</view>
						<view class="empty"></view>
					</view>
				</u-popup>
		<view style="width: 750rpx;height: 40rpx;">
			
		</view>
	</view>

</template>

<script>
	import {proporderInfotwo,propcancleRent} from "../../api/order.js"
	export default {
		data() {
			return {
				id:"",
				info:{},
				prop_image:"",
				prop_name:"",
				brand_name:"",
				status:"",
				tipShow2:false,
			}
		},
		onLoad(options) {
			console.log(options)
			this.id=options.id
			 this.status=options.status
			this.getinfo()
		},
		methods: {
			canelorder() {
				propcancleRent({
					id: this.info.id
				}).then(res => {
					if (res.code == 1) {
						this.tipShow2 = false,
						setTimeout(()=>{
							uni.navigateBack()
						},1500)
					}
					uni.$u.toast(res.msg)
					console.log(res, "取消订单")
				})
			},
			getinfo(){
				proporderInfotwo({
					id:this.id,
					status:this.status
				}).then(res=>{
					this.info=res.data
					// this.prop_image=res.data.prop.prop_image
					// this.prop_name=res.data.prop.prop_name
					// this.brand_name=res.data.prop.shop_brand.name
					console.log(this.info,"详情")
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 100vh;
		background-color: #262241;
		position: relative;
	}
	.main_from {
		width: 690rpx;
		height: 472rpx;
		background: #3C2F65;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0 auto;
		margin-top: 40rpx;

		
		.main_from_bottom{
			width: 630rpx;
			height: 420rpx;
			margin: 0 auto;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.title{
				font-size: 32rpx;
				color: #D8D5E0;
				margin-bottom: 10rpx;
			}
			.main_from_bottom_item{
				display: flex;
				justify-content: space-between;
				margin-bottom: 10rpx;
				>text{
					font-size: 26rpx;
					color: #FFFFFF;
				}
			}
		}
	}
	.main{
		width: 690rpx;
		height: 314rpx;
		background: #3C2F65;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}
	.main_from_top {
		margin: 0 auto;
		width: 630rpx;
		height: 220rpx;
		border-bottom: 2rpx solid rgba(216, 216, 216, 0.1);
		position: relative;
		background-color: #3C2F65;
		// border-radius: 16rpx 16rpx 16rpx 16rpx;
		>image {
			width: 154rpx;
			height: 154rpx;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin-top: 30rpx;
		}
	
		.name {
			width: 300rpx;
			position: absolute;
			top: 36rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 32rpx;
			color: #FFFFFF;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			/* 显示省略号 */
		}
		.text{
			width: 260rpx;
			position: absolute;
			top: 86rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #A6A5AF;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			/* 显示省略号 */
		}
		.price {
			position: absolute;
			top: 80rpx;
			right: 20rpx;
			display: flex;
			align-items: center;
			>image{
				width: 28rpx;
				height: 28rpx;
				margin-right: 6rpx;
			}
			font-size: 32rpx;
			color: #FFFFFF;
		}
		.tag_wrap{
			width: 300rpx;
			position: absolute;
			top: 146rpx;
			left: 192rpx;
			font-weight: 400;
			font-size: 24rpx;
			color: #A6A5AF;
			white-space: nowrap;
			/* 不换行 */
			overflow: hidden;
			/* 超出部分隐藏 */
			text-overflow: ellipsis;
			display: flex;
			/* 显示省略号 */
			.tag{
				width: 64rpx;
				height: 36rpx;
				background: linear-gradient( 274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%);
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				font-size: 22rpx;
				color: #FFFFFF;
				text-align: center;
				line-height: 36rpx;
			}
			.tag_num{
				width: 150rpx;
				height: 36rpx;
				background: #2B2951;
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				text-align: center;
				line-height: 36rpx;
				font-size: 24rpx;
				color: #FFFFFF;
			}

		}
		.tip{
			position: absolute;
			top: 74rpx;
			right: 0rpx;
			font-size: 36rpx;
			color: #FF2CDF;
		}
	}
	.main_btn_wrap{
		width: 630rpx;
		height: 100rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		.zz_btn{
			width: 122rpx;
			height: 52rpx;
			border-radius: 536rpx 536rpx 536rpx 536rpx;
			border: 2rpx solid #A6A5AF;
			font-size: 26rpx;
			color: #A7A4AD;
			text-align: center;
			line-height: 52rpx;
		}
		.gm_btn{
			width: 122rpx;
			height: 52rpx;
			border-radius: 536rpx 536rpx 536rpx 536rpx;
			border: 2rpx solid #FF2CDF;
			font-size: 26rpx;
			color: #FF2CDF;
			text-align: center;
			line-height: 52rpx;
			margin-right: 30rpx;
			margin-left: 30rpx;
		}
		
	}
	.btn{
		width: 690rpx;
		height: 88rpx;
		background: linear-gradient( 274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%);
		border-radius: 332rpx 332rpx 332rpx 332rpx;
		text-align: center;
		margin: 0 auto;
		margin-top: 100rpx;
		line-height: 88rpx;
		font-weight: 400;
		font-size: 36rpx;
		color: #FFFFFF;
	}
	.prompt {
		width: 600rpx;
		min-height: 400rpx;
		background: #2A2753;
		margin: 0 auto;
		border-radius: 20rpx;
		color: #ffffff;
		padding-top: 30rpx;
	}
	
	.prompt>text {
		margin-top: 40rpx;
	}
	
	.prompt_tit {
		margin: 0 30rpx;
		font-size: 28rpx;
		color: #A6A5AF;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
	
	.prompt_ntm {
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 30rpx;
		width: 414rpx;
		height: 72rpx;
		line-height: 72rpx;
		background: linear-gradient(274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%);
		border-radius: 28rpx;
		margin-top: 80rpx;
	}
</style>